home *** CD-ROM | disk | FTP | other *** search
- /* -*-c-*- */
-
- /* Copyright (C) 1989, 1992 Free Software Foundation, Inc.
-
- This file is part of GNU CC.
-
- GNU CC is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- GNU CC is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNU CC; see the file COPYING. If not, write to
- the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
- /* As a special exception, if you link this library with files
- compiled with GCC to produce an executable, this does not cause
- the resulting executable to be covered by the GNU General Public License.
- This exception does not however invalidate any other reasons why
- the executable file might be covered by the GNU General Public License. */
-
- /*
- $Header: /usr/user/dennis_glatting/ObjC/c-runtime/dispatch/RCS/Object.h,v 0.13 1992/08/18 04:46:58 dglattin Exp $
- $Author: dglattin $
- $Date: 1992/08/18 04:46:58 $
- $Log: Object.h,v $
- * Revision 0.13 1992/08/18 04:46:58 dglattin
- * Saving a working version before release.
- *
- * Revision 0.12 1992/04/13 11:43:08 dennisg
- * Check in after array version of run-time works.
- * Expect more changes as hash version and other changes are made.
- *
- * Revision 0.11 1992/01/03 02:55:03 dennisg
- * modified to handle new initialization scheme.
- * fixed code structure.
- *
- * Revision 0.10 1991/12/31 20:13:03 dennisg
- * Deleted index variable stuff. Index variables are a hack to the language.
- *
- * Revision 0.9 1991/12/07 00:49:28 dennisg
- * deleted +description:.
- *
- * Revision 0.8 1991/12/06 00:35:05 dennisg
- * deleted perform:with:: method.
- *
- * Revision 0.7 1991/11/30 14:19:18 dennisg
- * implemented archiving.
- *
- * Revision 0.6 1991/11/29 20:01:29 dennisg
- * fixed several const decls. bozo.
- *
- * Revision 0.5 1991/11/20 02:06:30 dennisg
- * returned doesNotRecognize:
- *
- * Revision 0.4 1991/11/19 12:37:24 dennisg
- * minr changes. still in a state of flux.
- *
- * Revision 0.3 1991/11/16 13:32:58 dennisg
- * changed #import statements to #include.
- * this should make gcc2 happy -- geez.
- *
- * Revision 0.2 1991/11/07 22:30:54 dennisg
- * added copyleft
- *
- * Revision 0.1 1991/10/24 00:45:39 dennisg
- * Initial check in. Preliminary development stage.
- *
- */
-
-
- #ifndef _object_INCLUDE_GNU
- #define _object_INCLUDE_GNU
-
- #include <objc.h>
- #include <stdio.h>
- #include <sys/types.h>
-
- #ifdef __NeXT__
- /* Need prototypes for read() and write().
- Most machines put these in stdio.h! */
- #include <libc.h>
- #endif
-
-
-
- /*
- * All classes are derived from Object. As such this is the
- * overhead tacked onto those objects.
- */
- @interface Object {
- Class_t isa; /* A pointer to the instance's
- class structure.
-
- This structure is the one
- generated by the compiler
- and located in the TEXT
- segment. The run-time uses
- its address as a key to
- run-time information. */
- }
-
- /* Creating, copying, and freeing instances */
-
- + new;
- + free;
- - free;
- - copy;
- - shallowCopy;
- - deepCopy;
-
- /* Identifying classes */
-
- + ( Class_t )class;
- + ( Class_t )superClass;
- - ( Class_t )class;
- - ( Class_t )superClass;
- - ( const char* )name;
-
- /* Identifying and comparing instances */
-
- - self;
- - ( u_int )hash;
- - ( BOOL )isEqual:anObject;
-
- /* Testing inheritance relationships */
-
- - ( BOOL )isKindOf:( Class_t )aClassObject;
- - ( BOOL )isMemberOf:( Class_t )aClassObject;
- - ( BOOL )isKindOfGivenName:( const char* )aClassName;
- - ( BOOL )isMemberOfGivenName:( const char* )aClassName;
-
- /* Testing class functionality */
-
- + ( BOOL )instancesRespondTo:( SEL )aSel;
- - ( BOOL )respondsTo:( SEL )aSel;
-
- /* Sending messages determined at run time */
-
- - perform:( SEL )aSel;
- - perform:( SEL )aSel with:aObject;
-
- /* Posing */
-
- + poseAs:( Class_t )aClassObject;
-
- /* Enforcing intentions */
-
- - subclassResponsibility:( SEL )aSel;
- - notImplemented:( SEL )aSel;
-
- /* Error handling */
-
- - doesNotRecognize:(SEL)aSelector;
- - error:( const char* )aString, ...;
- + error:( const char* )aString, ...;
-
- /* Archiving */
-
- - storeOn:( int )aFd;
- + readFrom:( int )aFd;
- - readFrom:( int )aFd;
- + ( int )version;
- + setVersion:( int )aVersion;
-
- @end
-
-
- #endif
-
-